<?php

namespace McUser\Model;
use Common\Model\CommonModel;

/*
 *  Copyright (c) 2014 The CCP project authors. All Rights Reserved.
 *
 *  Use of this source code is governed by a Beijing Speedtong Information Technology Co.,Ltd license
 *  that can be found in the LICENSE file in the root of the web site.
 *
 *   http://www.yuntongxun.com
 *
 *  An additional intellectual property rights grant can be found
 *  in the file PATENTS.  All contributing project authors may
 *  be found in the AUTHORS file in the root of the source tree.
 */

class McVipLevelModel extends CommonModel {

	function _initialize(){}

	protected $trueTableName = 'bg_vip_level';
	/* protected $dbName = 'asheng'; */

	/*   得到本果会员列表   */
	public function getVipList(){
		
		$vip_list = $this->select();		

		/*
		dump ($vip_list);
		*/

		return  $vip_list;		
	}

	/*   得到某一会员等级信息  */
	public function bgVipInfo($vipDaiMa){
		$condition = array('vipDaiMa' => $vipDaiMa);
		$info = $this->where($condition)->find();

		/* 读详细内容 */
		$vipList = C('vipList');
		$pid = $vipList[$vipDaiMa];		// 得到对应套餐的 post_id;

		$post = D('BgAbout');
		$post_data = $post->read_post($pid);

		$info['vipTitle']	= $post_data[0]['post_title'];
		$info['vipKeywords']	= $post_data[0]['post_keywords'];
		$info['vipExcerpt']	= $post_data[0]['post_excerpt'];
		$info['vipContent']	= $post_data[0]['post_content'];

		return  $info;				
	}	

public function getVipTitle($vipDaiMa){
		
		$vipTitle = $this->where('vipDaiMa=\''.$vipDaiMa.'\'')->getField('vipTitle');

		/*
		dump ($vipTitle);
		*/

		return  $vipTitle;		
	}	

	public function getVipName($vipDaiMa){
		
		$vipName = $this->where('vipDaiMa=\''.$vipDaiMa.'\'')->getField('vipName');

		/*
		dump ($vipTitle);
		*/

		return  $vipName;		
	}	

public function getVipPrice($vipDaiMa){
		
		$vipPrice = $this->where('vipDaiMa=\''.$vipDaiMa.'\'')->getField('vipPriceYear');

		/*
		dump ($vipPrice);
		*/

		return  $vipPrice;		
	}	

}